package com.quick.domain;

/**
 * Created by wangxin332 on 2018/5/13.
 */
public class UseEqualsAndHashCode1 {
    private Long id;
    private String name;
    private String age;

    @Override
    public boolean equals(final Object o) {
        if (o == this) return true;
        if (o == null) return false;
        if (o.getClass() != this.getClass()) return false;
        if (!super.equals(o)) return false;
        final UseEqualsAndHashCode1 other = (UseEqualsAndHashCode1)o;
        if (this.name == null ? other.name != null : !this.name.equals(other.name)) return false;
        if (this.name == null ? other.name != null : !this.name.equals(other.name)) return false;
        return true;
    }

    @Override
    public int hashCode(){
        final int PRIME = 31;
        int result = 1;
        result = result * PRIME + super.hashCode();
        result = result * PRIME + (this.name == null ? 0 : this.name.hashCode());
        result = result * PRIME + (this.age == null ? 0 : this.age.hashCode());
        return result;
    }
}
